package net.gxf.common.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * 快速导出TXT文件
 * 
 * @author: maybe
 * 
 */
public class ExportFileUtil {

	/**
	 * 
	 * @param path
	 *            导出的文件位置，例如： C:/test.txt
	 * @param bytes
	 */
	public static void ExportTxt(String path, byte[] bytes) {
		File file = new File(path.replace("\\", "/"));
		if (!file.getParentFile().exists())
			file.getParentFile().mkdirs();
		try {
			FileOutputStream fileOutputStream = new FileOutputStream(file);
			fileOutputStream.write(bytes);
			fileOutputStream.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void export(String path, OutputStream outputStream) {

	}

}
